<?php

use think\migration\Migrator;
use think\migration\db\Column;

class AlterAgentBalanceLogAddStatDateAndStatStatus extends Migrator
{
    public function up()
    {

        $sql = <<<SQL
ALTER TABLE `agent_balance_log`
ADD COLUMN `stat_at`  date NULL DEFAULT NULL COMMENT '对接有美-统计的时间，指什么月份产生的订单' AFTER `flow_step`,
ADD COLUMN `stat_status`  tinyint(1) NULL DEFAULT 0 COMMENT '对接有美-统计状态0未处理或无需统计1:已申请提现2:完成了提现' AFTER `stat_at`;


SQL;
        $this->execute($sql);
    }
    public function down()
    {
        $this->table('agent_balance_log')
            ->removeColumn('stat_at')
            ->removeColumn('stat_status')
            ->update();
    }
}
